products = [["iphone",6888],["MacPro",14800],["小米6",2499],["Coffee",31],["Book",60],["Nike",699]]
shop_car = []
print("------ 商品列表 ------")
for i in range(len(products)):
    product=products[i][0]
    price=products[i][1]
    print(product,price,sep="\t")
    shop_car.append([product,price,0])
choice=input("请输入你选择的商品：")
while choice!="q":
    for i in shop_car:
        if i[0]==choice:
            i[2] += 1
            break
    else:
        print("你输入的商品不存在。")
    choice=input("请继续输入你选择的商品：")
print("购物结束")
print("你购买了以下商品：")
for i in shop_car:
    if i[2]>0:
        print("{}{}件,共{}元".format(i[0],i[2],i[1]*i[2]))
# 1 少个退出的提示
# 2 少个购买成功的提示